﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nop.Core.Domain.Hotel;
using System.Data.Entity.ModelConfiguration;

namespace Nop.Data.Mapping.Hotel
{
    public partial class RoomTypePictureMap : EntityTypeConfiguration<RoomTypePicture>
    {
        public RoomTypePictureMap()
        {
            this.ToTable("RoomTypePicture");
            this.HasKey(p => p.Id);
            this.Property(p => p.DisplayOrder).IsRequired();

            this.HasRequired(pp => pp.Picture)
                .WithMany(p => p.RoomTypePictures)
                .HasForeignKey(pp => pp.PictureId);


            this.HasRequired(pp => pp.RoomType)
                .WithMany(p => p.RoomTypePicture)
                .HasForeignKey(pp => pp.RoomTypeID);
        }
    }
}
